package gist;
/**
 * describe:
 * author:gss
 * @note：
 * @knowledge:
 * create_time:${DATE} ${TIME}
 *
 */

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * describe:根据时间生成流水号
 * author:gss
 * create_time:2016/1/28 21:12
 */
public class AutoNumber {
    public String getCode() {
        Date date = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
        String dateString = dateFormat.format(date);
        SimpleDateFormat timeFormat = new SimpleDateFormat("HHmmsss");
        String timeString = timeFormat.format(date);
        return dateString + timeString;
    }

    public static void main(String[] args) {
        AutoNumber autoNumber = new AutoNumber();
        System.out.println(autoNumber.getCode());
    }
}
